import request from '@/utils/request'

// 新增业主合同
export function addProprietorContract(data) {
  return request({
    url: '/enterprise/contract/proprietorContract',
    method: 'post',
    data
  })
}

// 查询业主信息
export function getProprietorInfo(params) {
  return request({
    url: '/enterprise/contract/proprietorContract/proprietorInfo',
    method: 'get',
    params
  })
}

// 查询业主合同列表
export function listProprietorContract(params) {
  return request({
    url: '/enterprise/contract/proprietorContract/list',
    method: 'get',
    params
  })
}

//获取房管家信息
export function houseManagerList(params) {
  return request({
    url: '/enterprise/user/userBusiness/userList',
    method: 'get',
    params
  })
}

// 查询业主信息列表
export function listProprietor(params) {
  return request({
    url: '/enterprise/contract/proprietor/list',
    method: 'get',
    params
  })
}

// 合同模板下拉框
export function listContractTemplate(params) {
  return request({
    url: '/enterprise/contract/contractTemplate/list',
    method: 'get',
    params
  })
}

// 合同模板下拉框
export function pageElectronicVisa(params) {
  return request({
    url: '/enterprise/contract/contractTemplate/electronicVisa/page',
    method: 'get',
    params
  })
}

// 新增业主信息
export function addProprietor(data) {
  return request({
    url: '/enterprise/contract/proprietor',
    method: 'post',
    data
  })
}

// 新增房屋委托信息
export function addCommission(data) {
  return request({
    url: '/enterprise/contract/commission',
    method: 'post',
    data
  })
}

// 新增代理服务信息
export function addProxyService(data) {
  return request({
    url: '/enterprise/contract/proxyService',
    method: 'post',
    data
  })
}

// 获取业主信息详细信息(路径传业主信息id)
export function getProprietorDetail(id) {
  return request({
    url: '/enterprise/contract/proprietor/' + id,
    method: 'get'
  })
}

//获取代理服务信息
export function getProxyServiceDetail(id) {
  return request({
    url: '/enterprise/contract/proxyService/' + id,
    method: 'get'
  })
}

//新增代理服务信息-结算银行卡
export function settleBankCard(data) {
  return request({
    url: '/enterprise/contract/proxyService',
    method: 'put',
    data
  })
}


// 签署进度
export function getSigningProgress(params) {
  return request({
    url: '/enterprise/department/signProgress/list',
    method: 'get',
    params
  })
}

// 查看业主合同详细信息
export function getProprietorContractDetail(id) {
  return request({
    url: '/enterprise/contract/proprietorContract/' + id,
    method: 'get'
  })
}

// 上传合同
export function uploadProprietorContractImage(data) {
  return request({
    url: '/enterprise/contract/proprietorContract/uploadContractImage',
    method: 'put',
    data
  })
}

//撤销合同
export function repealProprietorContract(data) {
  return request({
    url: '/enterprise/contract/proprietorContract/repeal',
    method: 'put',
    data
  })
}

// 签署合同
export function signingProprietorContract(data) {
  return request({
    url: '/enterprise/contract/proprietorContract/signing',
    method: 'put',
    data
  })
}

// 获取预览电子合同内容链接
export function previewElectronicVisaUrl(data) {
  return request({
    url: '/enterprise/contract/proprietorContract/previewUrl',
    method: 'post',
    data: data
  })
}

// 扫码认证(代理服务id)
export function getScanAuth(id) {
  return request({
    url: '/enterprise/contract/proxyService/scanAuth/'+id,
    method: 'get',
  })
}

// 业主开户(个人)(路径传业主id)
export function ownerOpenAccountProprietor(data,id) {
  return request({
    url: '/enterprise/contract/proxyService/ownerOpenAccount/'+id,
    method: 'post',
    data: data
  })
}

// 业主开户(企业)(路径传业主id)
export function ownerOpenAccountCompanyProprietor(data,id) {
  return request({
    url: '/enterprise/contract/proxyService/ownerOpenAccount/'+id,
    method: 'post',
    data: data
  })
}

// 业主结算银行卡(路径传业主id)
export function settleBankCardProprietor(data,id) {
  return request({
    url: '/enterprise/contract/proxyService/ownerBindMerchant/'+id,
    method: 'post',
    data: data
  })
}

